package com.erlinyou.im.dao.repository.groupmove;

import java.util.List;
import java.util.Map;

import org.springframework.data.jpa.repository.Query;

import com.erlinyou.base.dao.BaseRepository;
import com.erlinyou.im.model.groupmove.Ofmucroom;
import com.erlinyou.im.model.groupmove.OfmucroomId;

public interface OfmucroomRepository extends BaseRepository<Ofmucroom, OfmucroomId>{

	@Query(value="SELECT c.roomID,c.creationDate,c.`name`,c.naturalName,a.jid from ofmucroom c LEFT JOIN ofmucaffiliation a ON c.roomID = a.roomID LIMIT ?1,?2",nativeQuery=true)
	List<Map<String, Object>> seleRoomId(int startPage, int rows);

	@Query(value="SELECT * FROM ofmucroom WHERE name = ?1",nativeQuery=true)
	Map<String,Object> findByName(String name);

	
}
